package cn.zwx.member.svc.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * @author zhangwenxue
 */
@Data
@ApiModel("用户地址入参基类")
public class AddressBaseDTO {

    @ApiModelProperty(value = "收件人名称",required = true)
    @NotBlank(message = "收件人名称不能为空")
    private String name;

    @Length(max = 11, min = 11, message = "手机号码格式有误")
    @ApiModelProperty(value = "手机号", required = true)
    @NotBlank(message = "手机号不能为空")
    private String mobile;

    @ApiModelProperty(value = "省份编号", required = true)
    @NotNull(message = "省份编号不能为空")
    private Long provinceId;

    @ApiModelProperty(value = "城市编号", required = true)
    @NotNull(message = "城市编号不能为空")
    private Long cityId;

    @ApiModelProperty(value = "区县编号", required = true)
    @NotNull(message = "区县编号不能为空")
    private Long districtId;

    @Length(max = 200, min = 1, message = "收件详细地址长度必须在1到200之间")
    @ApiModelProperty(value = "收件详细地址", required = true)
    @NotNull(message = "收件详细地址不能为空")
    private String detailAddress;

    @ApiModelProperty(value = "是否默认地址", required = true)
    @NotNull(message = "是否默认地址不能为空")
    private Boolean defaultStatus;
}
